﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Polaris.EntityFrameworkCore.Migrations
{
    /// <inheritdoc />
    public partial class InitialCreate : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
   

            migrationBuilder.CreateTable(
                name: "Notes",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "主键", collation: "ascii_general_ci"),
                    Title = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false, comment: "笔记标题")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Weather = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "天气")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    WeatherIcon = table.Column<string>(type: "longtext", nullable: true, comment: "天气图标")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Mood = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "心情")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MoodIcon = table.Column<string>(type: "longtext", nullable: true, comment: "心情图标")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Content = table.Column<string>(type: "longtext", nullable: false, comment: "笔记内容 数据量不大 直接放在一张表")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Password = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "私密笔记密码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsRedFlag = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否红旗"),
                    IsComments = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否可以评论"),
                    Browse = table.Column<int>(type: "int", nullable: false, comment: "浏览数"),
                    Like = table.Column<int>(type: "int", nullable: false, comment: "喜欢"),
                    IsPrivacy = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否私密"),
                    Enable = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否可用"),
                    IsDelete = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否删除"),
                    NotesUpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "闲书内容最后更新时间"),
                    CreateBy = table.Column<Guid>(type: "char(36)", nullable: true, comment: "创建人", collation: "ascii_general_ci"),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "创建时间"),
                    UpdateBy = table.Column<Guid>(type: "char(36)", nullable: true, comment: "更新人", collation: "ascii_general_ci"),
                    UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "更新时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Notes", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");


            migrationBuilder.CreateIndex(
                name: "IX_Sys_Dictionary_Code",
                table: "Sys_Dictionary",
                column: "Code",
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "ArticleContent");

            migrationBuilder.DropTable(
                name: "ArticleDictionaryRelation");

            migrationBuilder.DropTable(
                name: "ArticleInfo");

            migrationBuilder.DropTable(
                name: "Notes");

            migrationBuilder.DropTable(
                name: "Sys_Dictionary");

            migrationBuilder.DropTable(
                name: "Sys_Dictionary_Item");

            migrationBuilder.DropTable(
                name: "Sys_Menu");

            migrationBuilder.DropTable(
                name: "Sys_MenuRole");

            migrationBuilder.DropTable(
                name: "Sys_Role");

            migrationBuilder.DropTable(
                name: "Sys_User");

            migrationBuilder.DropTable(
                name: "Sys_UserMenu");

            migrationBuilder.DropTable(
                name: "Sys_UserRole");

            migrationBuilder.DropTable(
                name: "Tag");

            migrationBuilder.DropTable(
                name: "UnifyMessage");

            migrationBuilder.DropTable(
                name: "Web_Site");
        }
    }
}
